package com.levi.mall.service;

import com.levi.form.CartAddForm;
import com.levi.form.CartUpdateForm;
import com.levi.pojo.Cart;
import com.levi.vo.CartVo;
import com.levi.vo.ResponseVo;
import io.swagger.models.auth.In;

import java.util.List;

/**
 * @author shentong
 * @since 2022/3/30 10:22 PM
 */
public interface CartService {
    /**
     * 添加购物车
     * @param uid
     * @param cartAddForm
     * @return
     */
    ResponseVo<CartVo> add(Integer uid,CartAddForm cartAddForm);

    /**
     * 查询用户购物车中的所有商品信息
     * @param uid
     * @return
     */
    ResponseVo<CartVo> cartList(Integer uid);

    /**
     * 修改购物车指定商品
     * @param uid
     * @param productId
     * @param form
     * @return
     */
    ResponseVo<CartVo> updateCart(Integer uid, Integer productId, CartUpdateForm form);

    /**
     * 删除购物车中指定商品
     * @param uid
     * @param productId
     * @return
     */
    ResponseVo<CartVo> deleteCart(Integer uid, Integer productId);

    /**
     * 全选
     * @param uid
     * @return
     */
    ResponseVo<CartVo> selectAll(Integer uid);

    /**
     * 根据用户id获取购物车列表
     * @param uid
     * @return
     */
    List<Cart> listForCart(Integer uid);

    /**
     * 全不选
     * @param uid
     * @return
     */
    ResponseVo<CartVo> unSelectAll(Integer uid);

    /**
     * 购物车中所有商品数量总和
     * @param uid
     * @return
     */
    ResponseVo<Integer> sum(Integer uid);
}
